package com.lesylphe.memoryboost;

public class Defi {

	private String question;

	private String reponse;

	private int nombreBonneReponse, nombreMauvaiseReponse;

	public Defi(String question, String reponse) {
		this.question = question;
		this.reponse = reponse;
	}

	public String getQuestion() {
		return question;
	}

	public void setQuestion(String question) {
		this.question = question;
	}

	public String getQuestionPlusTaux() {
		return getQuestion() + " (" + nombreBonneReponse + " bonnes / "
				+ nombreMauvaiseReponse + " mauvaises)";
	}

	public String getReponse() {
		return reponse;
	}

	public void setReponse(String reponse) {
		this.reponse = reponse;
	}

	public void prendreEnCompteReponse(boolean b) {
		if (b) {
			nombreBonneReponse++;
		} else {
			nombreMauvaiseReponse++;
		}
	}

	public int getDeltaReponse() {
		return nombreBonneReponse - nombreMauvaiseReponse;
	}

	@Override
	public String toString() {
		return "Defi [question=" + question + ", nombreBonneReponse="
				+ nombreBonneReponse + ", nombreMauvaiseReponse="
				+ nombreMauvaiseReponse + "]";
	}

	public void raz() {
		nombreBonneReponse = 0;
		nombreMauvaiseReponse = 0;
	}

}
